Only show the separator if both children are present and visible.
authorOwen Taylor <otaylor@redhat.com>
Mon, 21 May 2001 15:56:19 +0000 (15:56 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 21 May 2001 15:56:19 +0000 (15:56 +0000)
Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>

* gtk/gtk{h,v,}paned.c: Only show the separator if both children
are present and visible.

* configure.in: Fixed reversed conditional causing all image
libraries to be linked in.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
docs/reference/gtk/tmpl/gtkrc.sgml
gtk/gtkhpaned.c
gtk/gtkpaned.c
gtk/gtkvpaned.c

index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 90b2c1ef08c2071e021d03c1de20fecfb12e1cd3..a1aff594cd017a594bf871494f463e97cff0fa37 100644 (file)
@@ -1,3 +1,10 @@
+Mon May 21 11:29:21 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtk{h,v,}paned.c: Only show the separator if 
+
+       * configure.in: Fixed reversed conditional causing all image
+       libraries to be linked in.
+
 2001-05-21  Joe Shaw  <joe@ximian.com>
 
        * gtk/gtklayout.c (gtk_text_layout_get_lines): Remove the assertion
index 2f4452760036bafc30d69edddd69e4a3dadba0e5..58e8015e74f21e51744deebd9aefcffccc4786ec 100644 (file)
@@ -564,8 +564,6 @@ AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
 
 if $dynworks ; then
-  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
-else
   STATIC_LIB_DEPS=
   if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
@@ -576,6 +574,8 @@ else
   if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
   fi
+else
+  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
 fi
 
 # Checks to see if we should compile in MMX support (there will be
index 88a0a4a50768b9125a3501db571c351823709144..aeceb3e5ec5128ed4fb5e158a0cdbac4c0421aeb 100644 (file)
@@ -495,7 +495,6 @@ This can later be composited together with other
 #GtkRcStyle structures to form a #GtkStyle.
 </para>
 
-@parent_instance: 
 @name: 
 @bg_pixmap_name: 
 @font_desc: 
index 5b8d810dcb13c93c7d1ba410e3644c66ff34b042..8bdf6a70b128782298ff33957b0c4b3bd069c08e 100644 (file)
@@ -115,9 +115,6 @@ gtk_hpaned_size_request (GtkWidget      *widget,
 {
   GtkPaned *paned = GTK_PANED (widget);
   GtkRequisition child_requisition;
-  gint handle_size;
-
-  gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
 
   requisition->width = 0;
   requisition->height = 0;
@@ -138,8 +135,17 @@ gtk_hpaned_size_request (GtkWidget      *widget,
       requisition->width += child_requisition.width;
     }
 
-  requisition->width += GTK_CONTAINER (paned)->border_width * 2 + handle_size;
+  requisition->width += GTK_CONTAINER (paned)->border_width * 2;
   requisition->height += GTK_CONTAINER (paned)->border_width * 2;
+
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    {
+      gint handle_size;
+      
+      gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
+      requisition->width += handle_size;
+    }
 }
 
 static void
@@ -148,78 +154,90 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
 {
   GtkPaned *paned = GTK_PANED (widget);
   gint border_width = GTK_CONTAINER (paned)->border_width;
-  gint handle_size;
-  GtkRequisition child1_requisition;
-  GtkRequisition child2_requisition;
-  GtkAllocation child1_allocation;
-  GtkAllocation child2_allocation;
-
-  gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
 
   widget->allocation = *allocation;
-  
-  if (paned->child1)
-    gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
-  else
-    child1_requisition.width = 0;
-
-  if (paned->child2)
-    gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
-  else
-    child2_requisition.width = 0;
-
-  gtk_paned_compute_position (paned,
-                             MAX (1, widget->allocation.width
-                                     - handle_size
-                                  - 2 * border_width),
-                             child1_requisition.width,
-                             child2_requisition.width);
-
-  /* Move the handle before the children so we don't get extra expose events */
-
-  paned->handle_xpos = paned->child1_size + border_width;
-  paned->handle_ypos = border_width;
-  paned->handle_width = handle_size;
-  paned->handle_height = MAX (1, widget->allocation.height - 2 * border_width);
-
   if (GTK_WIDGET_REALIZED (widget))
-    {
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width,
-                             allocation->height);
-
-      gdk_window_move_resize (paned->handle,
-                             paned->handle_xpos,
-                             paned->handle_ypos,
-                             handle_size,
-                             paned->handle_height);
-    }
+    gdk_window_move_resize (widget->window,
+                           allocation->x, allocation->y,
+                           allocation->width,
+                           allocation->height);
 
-  child1_allocation.height = child2_allocation.height = MAX (1, (gint) allocation->height - border_width * 2);
-  child1_allocation.width = paned->child1_size;
-  child1_allocation.x = border_width;
-  child1_allocation.y = child2_allocation.y = border_width;
-  
-  child2_allocation.x = child1_allocation.x + child1_allocation.width +  paned->handle_width;
-  child2_allocation.width = MAX (1, (gint) allocation->width - child2_allocation.x - border_width);
-
-  /* Now allocate the childen, making sure, when resizing not to
-   * overlap the windows */
-  if (GTK_WIDGET_MAPPED (widget) &&
-      paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child1->allocation.width < child1_allocation.width)
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
     {
-      if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-       gtk_widget_size_allocate (paned->child2, &child2_allocation);
-      gtk_widget_size_allocate (paned->child1, &child1_allocation);
+      GtkAllocation child1_allocation;
+      GtkAllocation child2_allocation;
+      GtkRequisition child1_requisition;
+      GtkRequisition child2_requisition;
+      gint handle_size;
+      
+      gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
+
+      gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
+      gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
+      
+      gtk_paned_compute_position (paned,
+                                 MAX (1, widget->allocation.width
+                                      - handle_size
+                                      - 2 * border_width),
+                                 child1_requisition.width,
+                                 child2_requisition.width);
+      
+      /* Move the handle before the children so we don't get extra expose events */
+      
+      paned->handle_xpos = paned->child1_size + border_width;
+      paned->handle_ypos = border_width;
+      paned->handle_width = handle_size;
+      paned->handle_height = MAX (1, widget->allocation.height - 2 * border_width);
+      
+      if (GTK_WIDGET_REALIZED (widget))
+       {
+         gdk_window_show (paned->handle);
+         gdk_window_move_resize (paned->handle,
+                                 paned->handle_xpos,
+                                 paned->handle_ypos,
+                                 handle_size,
+                                 paned->handle_height);
+       }
+      
+      child1_allocation.height = child2_allocation.height = MAX (1, (gint) allocation->height - border_width * 2);
+      child1_allocation.width = paned->child1_size;
+      child1_allocation.x = border_width;
+      child1_allocation.y = child2_allocation.y = border_width;
+      
+      child2_allocation.x = child1_allocation.x + child1_allocation.width +  paned->handle_width;
+      child2_allocation.width = MAX (1, (gint) allocation->width - child2_allocation.x - border_width);
+      
+      /* Now allocate the childen, making sure, when resizing not to
+       * overlap the windows */
+      if (GTK_WIDGET_MAPPED (widget) &&
+         paned->child1->allocation.width < child1_allocation.width)
+       {
+         gtk_widget_size_allocate (paned->child2, &child2_allocation);
+         gtk_widget_size_allocate (paned->child1, &child1_allocation);
+       }
+      else
+       {
+         gtk_widget_size_allocate (paned->child1, &child1_allocation);
+         gtk_widget_size_allocate (paned->child2, &child2_allocation);
+       }
     }
   else
     {
+      GtkAllocation child_allocation;
+
+      if (GTK_WIDGET_REALIZED (widget))      
+       gdk_window_hide (paned->handle);
+         
+      child_allocation.x = border_width;
+      child_allocation.y = border_width;
+      child_allocation.width = MAX (1, allocation->width - 2 * border_width);
+      child_allocation.height = MAX (1, allocation->height - 2 * border_width);
+      
       if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-       gtk_widget_size_allocate (paned->child1, &child1_allocation);
-      if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-       gtk_widget_size_allocate (paned->child2, &child2_allocation);
+       gtk_widget_size_allocate (paned->child1, &child_allocation);
+      else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+       gtk_widget_size_allocate (paned->child2, &child_allocation);
     }
 }
 
index 9cc0357c9495fa500cd1a2ed600a571b65536640..71860cce7c37f659036e2afd3f8a526a7e4102c2 100644 (file)
@@ -267,7 +267,9 @@ gtk_paned_realize (GtkWidget *widget)
 
   gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 
-  gdk_window_show (paned->handle);
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    gdk_window_show (paned->handle);
 }
 
 static void
index df75c14197ec80078503aa405e0402bbde16a095..ae9ff11812ad6e39566c343afd2280c98e743991 100644 (file)
@@ -115,9 +115,6 @@ gtk_vpaned_size_request (GtkWidget      *widget,
 {
   GtkPaned *paned = GTK_PANED (widget);
   GtkRequisition child_requisition;
-  gint handle_size;
-
-  gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
 
   requisition->width = 0;
   requisition->height = 0;
@@ -138,8 +135,17 @@ gtk_vpaned_size_request (GtkWidget      *widget,
       requisition->height += child_requisition.height;
     }
 
-  requisition->height += GTK_CONTAINER (paned)->border_width * 2 + handle_size;
+  requisition->height += GTK_CONTAINER (paned)->border_width * 2;
   requisition->width += GTK_CONTAINER (paned)->border_width * 2;
+  
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    {
+      gint handle_size;
+
+      gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
+      requisition->height += handle_size;
+    }
 }
 
 static void
@@ -147,80 +153,91 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
                          GtkAllocation *allocation)
 {
   GtkPaned *paned = GTK_PANED (widget);
-  GtkRequisition child1_requisition;
-  GtkRequisition child2_requisition;
-  GtkAllocation child1_allocation;
-  GtkAllocation child2_allocation;
-  gint border_width;
-  gint handle_size;
+  gint border_width = GTK_CONTAINER (paned)->border_width;
 
   widget->allocation = *allocation;
-
-  border_width = GTK_CONTAINER (widget)->border_width;
-  gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
-
-  if (paned->child1)
-    gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
-  else
-    child1_requisition.height = 0;
-
-  if (paned->child2)
-    gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
-  else
-    child2_requisition.height = 0;
-    
-  gtk_paned_compute_position (paned,
-                             MAX (1, widget->allocation.height
-                                  - handle_size
-                                  - 2 * border_width),
-                             child1_requisition.height,
-                             child2_requisition.height);
-
-  /* Move the handle before the children so we don't get extra expose events */
-
-  paned->handle_xpos = border_width;
-  paned->handle_ypos = paned->child1_size + border_width;
-  paned->handle_width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
-  paned->handle_height = handle_size;
-
-  if (GTK_WIDGET_REALIZED(widget))
+  if (GTK_WIDGET_REALIZED (widget))
+    gdk_window_move_resize (widget->window,
+                           allocation->x, allocation->y,
+                           allocation->width,
+                           allocation->height);
+
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
     {
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width,
-                             allocation->height);
-
-      gdk_window_move_resize (paned->handle,
-                             paned->handle_xpos,
-                             paned->handle_ypos,
-                             paned->handle_width,
-                             handle_size);
-    }
-
-  child1_allocation.width = child2_allocation.width = MAX (1, (gint) allocation->width - border_width * 2);
-  child1_allocation.height = paned->child1_size;
-  child1_allocation.x = child2_allocation.x = border_width;
-  child1_allocation.y = border_width;
-
-  child2_allocation.y = child1_allocation.y + child1_allocation.height + paned->handle_height;
-  child2_allocation.height = MAX(1, (gint) allocation->height - child2_allocation.y - border_width);
+      GtkRequisition child1_requisition;
+      GtkRequisition child2_requisition;
+      GtkAllocation child1_allocation;
+      GtkAllocation child2_allocation;
+      gint handle_size;
+      
+      gtk_widget_style_get (widget, "handle_size", &handle_size, NULL);
+
+      gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
+      gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
+    
+      gtk_paned_compute_position (paned,
+                                 MAX (1, widget->allocation.height
+                                      - handle_size
+                                      - 2 * border_width),
+                                 child1_requisition.height,
+                                 child2_requisition.height);
+
+      /* Move the handle before the children so we don't get extra expose events */
+
+      paned->handle_xpos = border_width;
+      paned->handle_ypos = paned->child1_size + border_width;
+      paned->handle_width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
+      paned->handle_height = handle_size;
+      
+      if (GTK_WIDGET_REALIZED(widget))
+       {
+         gdk_window_show (paned->handle);
+         gdk_window_move_resize (paned->handle,
+                                 paned->handle_xpos,
+                                 paned->handle_ypos,
+                                 paned->handle_width,
+                                 handle_size);
+       }
 
-  /* Now allocate the childen, making sure, when resizing not to
-   * overlap the windows */
-  if (GTK_WIDGET_MAPPED (widget) &&
-      paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child1->allocation.height < child1_allocation.height)
-    {
-      if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-       gtk_widget_size_allocate(paned->child2, &child2_allocation);
-      gtk_widget_size_allocate(paned->child1, &child1_allocation);
+      child1_allocation.width = child2_allocation.width = MAX (1, (gint) allocation->width - border_width * 2);
+      child1_allocation.height = paned->child1_size;
+      child1_allocation.x = child2_allocation.x = border_width;
+      child1_allocation.y = border_width;
+      
+      child2_allocation.y = child1_allocation.y + child1_allocation.height + paned->handle_height;
+      child2_allocation.height = MAX(1, (gint) allocation->height - child2_allocation.y - border_width);
+      
+      /* Now allocate the childen, making sure, when resizing not to
+       * overlap the windows */
+      if (GTK_WIDGET_MAPPED (widget) &&
+         paned->child1->allocation.height < child1_allocation.height)
+       {
+         gtk_widget_size_allocate(paned->child2, &child2_allocation);
+         gtk_widget_size_allocate(paned->child1, &child1_allocation);
+       }
+      else
+       {
+         gtk_widget_size_allocate(paned->child1, &child1_allocation);
+         gtk_widget_size_allocate(paned->child2, &child2_allocation);
+       }
     }
   else
     {
+      GtkAllocation child_allocation;
+
+      if (GTK_WIDGET_REALIZED (widget))      
+       gdk_window_hide (paned->handle);
+         
+      child_allocation.x = border_width;
+      child_allocation.y = border_width;
+      child_allocation.width = MAX (1, allocation->width - 2 * border_width);
+      child_allocation.height = MAX (1, allocation->height - 2 * border_width);
+      
       if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-       gtk_widget_size_allocate(paned->child1, &child1_allocation);
-      if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-       gtk_widget_size_allocate(paned->child2, &child2_allocation);
+       gtk_widget_size_allocate (paned->child1, &child_allocation);
+      else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+       gtk_widget_size_allocate (paned->child2, &child_allocation);
     }
 }